package com.yc.jpyy.base.config;

import java.io.IOException;
import java.util.Properties;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * 获取config.properties配置文件的地址
 */
public class Config {
	private static Properties prop = null;
	static final Logger logger = LoggerFactory.getLogger(Config.class);
	/**
	 * load config
	 **/
	static {
		loadProp();
	}

	/**
	 * load the config into cache
	 **/
	public static void loadProp() {
		try {
			prop = new Properties();
			prop.load(Config.class.getClassLoader().getResourceAsStream(
					"config.properties"));
		} catch (IOException e) {
			logger.info("load config failed:" + e.getMessage());
		}
	}

	/**
	 * 保存文件路径
	 **/
	public static String getFilePath() {
		return prop.getProperty("file.save", "");
	}
	
	/**
	 * 门户网站地址
	 **/
	public static String getWebUrl() {
		return prop.getProperty("web.url", "");
	}
	

	public static String getUpServerUrl () {
		return prop.getProperty("UpServerUrl", "");
	}
	public static String getUpLastver () {
		return prop.getProperty("UpLastver", "");
	}
	public static String getUpEnabled () {
		return prop.getProperty("UpEnabled", "");
	}
	
	public static String getLogonPeriod () {
		return prop.getProperty("LogonPeriod", "");
	}
	
	public static String getAPP_ID () {
		return prop.getProperty("APP_ID", "");
	}
	
	public static String getAPI_KEY () {
		return prop.getProperty("API_KEY", "");
	}
	
	public static String getSECRET_KEY () {
		return prop.getProperty("SECRET_KEY", "");
	}
	
	//聚合短信平台
	public static String getAPPKEY () {
		return prop.getProperty("APPKEY", "");
	}
	
	//增删改日志是否单独开启
		public static String getISOPENMSG_LOG () {
			return prop.getProperty("ISOPENMSG_LOG", "");
		}
    //外网的IP
	public static String getWWIP () {
			return prop.getProperty("WWIP", "");
	}
		//外网的IP的端口
	public static String getWWPORT () {
			return prop.getProperty("WWPORT", "");
	}
	

}
